//ajax属于异步调用  和同步           异步属于随机执行
function myAjax(url, data, type) {
    let da;
    $.ajax({
        url: url,
        data: data,
        type: type == null ? 'get' : 'post',
        dataType: 'json',
        async: false,
        success: function (res) {
            console.log(res);
            da = res;
        }
    });
    return da;
}